import 'package:flutter/cupertino.dart';
import 'package:flutter_basic_learning/utils/CommonWidget.dart';
import 'package:flutter_basic_learning/views/getx/getx_controller/DataShareController.dart';
import 'package:get/get.dart';

class PageTwo extends StatelessWidget {
  PageTwo({super.key});
  final DataShareController shareData = Get.put(DataShareController());

  @override
  Widget build(BuildContext context) {
    return commonScaffold('多页面数据共享 - 页面2', [
      Obx(() => commonText('多页面共享数据： ${shareData.count.value}')),
      commonButton('count+1', () {
        shareData.count.value++;
      }),
      commonButton('返回PageOne', () {
        Get.back();
      })
    ]);
  }
}
